import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ArticleListWidget extends StatelessWidget {
  String title = "", author = "", category = "", tag = "";

  ArticleListWidget(this.title, this.author, this.category);

  @override
  Widget build(BuildContext context) {
    print("test$author");
    return Card(
      ///设置阴影的深度
      elevation: 3.0,

      ///增加圆角
      shape: const RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(10.0))),
      color: Colors.white,
      margin: const EdgeInsets.only(left: 15.0, right: 15.0, top: 15),
      child: Container(
        alignment: Alignment.topLeft,
        padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
        child: Column(
          children: [
            SizedBox(
                width: double.infinity,
                child: Text(title,
                    style: const TextStyle(fontSize: 16),
                    maxLines: 2,
                    overflow: TextOverflow.ellipsis,
                    textAlign: TextAlign.left)),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  author,
                  style: const TextStyle(fontSize: 10, color: Colors.grey),
                  textAlign: TextAlign.start,
                ),
                Text(category,
                    style: const TextStyle(fontSize: 10, color: Colors.grey),
                    textAlign: TextAlign.center),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
